﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Text;

namespace crm_data
{
    /// <summary>
    /// 客户地址信息
    /// 只对于订单收货使用
    /// </summary>
    [Table("basics_customer_address")]
    public class CustomerAddress : Entity
    {
        #region Model 实体属性

        /// <summary>
        /// 收件人姓名
        /// </summary>
        [Required]
        public string RealName { get; set; }
        /// <summary>
        /// 联系电话
        /// </summary>
        [Required]
        [StringLength(11)]
        public string Telphone1 { get; set; }
        /// <summary>
        /// 备用电话
        /// </summary>
        [StringLength(11)]
        public string Telphone2 { get; set; }
        /// <summary>
        /// 国家
        /// </summary>
        [Required]
        public int Country { get; set; }
        /// <summary>
        /// 省份
        /// </summary>
        [Required]
        public int Province { get; set; }
        /// <summary>
        /// 城市
        /// </summary>
        [Required]
        public int City { get; set; }
        /// <summary>
        /// 地区
        /// </summary>
        [Required]
        public int Area { get; set; }
        /// <summary>
        /// 地址
        /// </summary>
        [Required]
        [MaxLength(120)]
        public string Street { get; set; }
        /// <summary>
        /// 邮政编码
        /// </summary>
        [Required]
        [StringLength(6)]
        public string ZipCode { get; set; }
        /// <summary>
        /// 是否默认为收货地址
        /// </summary>
        [Required]
        public bool IsDefault { get; set; } = false;
        /// <summary>
        /// 创建时间
        /// </summary>
        [Required]
        [DataType(DataType.Date)]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 修改时间
        /// </summary>
        [DataType(DataType.Date)]
        public DateTime? UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 客户标识
        /// </summary>
        public Guid CustomerGuid { get; set; }

        #endregion Model 实体属性

        /// <summary>
        /// 客户信息
        /// </summary>
        public Customer Customer { get; set; }
    }
}
